package com.sihai.ehr.service;

import java.util.List;

import com.sihai.core.Limit;
import com.sihai.core.LimitedList;
import com.sihai.core.Sorter;
import com.sihai.ehr.model.biz.TrainOutingPlanCloseAuditing;
import com.sihai.ehr.model.biz.TrainPlan;
import com.sihai.ehr.model.biz.TrainPlanAuditing;
import com.sihai.ehr.model.sys.AuditStatus;

/**
 * 培训计划服务接口
 * 
 * @author henry
 * 
 */
public interface TrainPlanService {
	/** 获取培训计划 */
	TrainPlan getTrainPlan(Long id);

	/**
	 * 根据组织结构编号获取培训类型列表
	 * 
	 * @param organizationId
	 * @param dutyId
	 * @param lecturerType
	 *            内训:0外训:1　；ALL:-1
	 * @param limit
	 * @param sorter
	 * @return
	 */
	LimitedList<TrainPlan> getTrainPlans(Long organizationId, Long dutyId, int lecturerType, AuditStatus auditStatus, Limit limit, Sorter sorter);
	
	LimitedList<TrainPlan> getTrainPlans(int year, int lecturerType, String category, Long lecturerWorkId, Limit limit, Sorter sorter);

	/**
	 * 根据组织结构获取个人培训计划列表
	 * 
	 * @param organizationId
	 * @param dutyId
	 * @param userId
	 * @param limit
	 * @param sorter
	 * @return
	 */
	LimitedList<TrainPlan> getTrainPlansByUserId(final Long organizationId, Long dutyId, final Long userId, Limit limit, Sorter sorter);

	LimitedList<TrainPlan> getTrainPlansByWorkId(final Long workId, Limit limit, Sorter sorter);

	/** 保存培训类型 */
	void save(TrainPlan trainPlan);

	/**
	 * 删除培训类型
	 * 
	 * @param categoryId
	 */
	void deleteTrainPlan(String ids);

	/**
	 * 保存培训计划审核
	 * 
	 * @param trainPlan
	 * @param auditNo
	 */
	void saveTrainPlanAuditingProcess(TrainPlan trainPlan, int auditNo);
	
	/**
	 * 保存培训计划审核
	 * @param trainPlan
	 * @param auditNo
	 */
	void saveTrainPlanCloseAuditingProcess(TrainPlan trainPlan, int auditNo);

	/**
	 * 获取培训计划审核结果
	 * 
	 * @param trainPlanId
	 * @param limit
	 * @param sorter
	 * @return
	 */
	List<List<TrainPlanAuditing>> searchTrainPlanAuditings(Long trainPlanId, Limit limit, Sorter sorter);
	
	/**
	 * 获取外训审核结果
	 * 
	 * @param trainPlanId
	 * @param limit
	 * @param sorter
	 * @return
	 */
	List<List<TrainOutingPlanCloseAuditing>> searchTrainPlanCloseAuditings(Long trainPlanId, Limit limit, Sorter sorter);

}
